﻿@using Digital.WCFClient.ConfigService
@using System.Collections.ObjectModel
@using Digital.Common.Mvc.Extensions
@using Digital.Web.Controllers
@using Microsoft.AspNet.Identity
@model Digital.WCFClient.ConfigService.CompanyModel
@{
    ViewBag.Title = "企业基础信息";
    Layout = "~/Views/Shared/_LayoutDigital.cshtml";
}

@section PageSpecificJavascriptIncludes{
    <link rel="stylesheet" href="../DigitalStyle/css/bootstrap-override.css" />
    <link rel="stylesheet" href="../DigitalStyle/css/jquery.gritter.css" />

    <script src="../DigitalStyle/js/bootstrap-wizard.min.js"></script>
    <script src="../DigitalStyle/js/jquery.gritter.min.js"></script>
    <script src="../DigitalStyle/js/jquery.validate.js"></script>
    <script src="../DigitalStyle/js/JqueryToken.js"></script>
    <script src="../DigitalStyle/js/jquery.autogrow-textarea.js"></script>
    <script src="../DigitalStyle/js/messages_cn.js"></script>
    <script src="../DigitalStyle/js/formvalidator.js"></script>
}
<div class="pageheader">
    <h2><i class="fa fa-user"></i> 信息设置 <span>企业中心</span></h2>
    <div class="breadcrumb-wrapper">
        <span class="label">你的位置:</span>
        <ol class="breadcrumb">
            <li><a href="">企业中心</a></li>
            <li class="active">信息设置</li>
        </ol>
    </div>
</div>


<div class="contentpanel">
    <div class="row">

        <div class="col-md-12">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <div class="panel-btns">
                        <a href="" class="panel-close">&times;</a>
                        <a href="" class="minimize">&minus;</a>
                    </div>
                    <h4 class="panel-title">企业信息</h4>
                    <p>完善企业信息，让客户更了解您.</p>
                </div>
                <div class="panel-body panel-body-nopadding">

                    <!-- BASIC WIZARD -->
                    <div id="progressWizard" class="basic-wizard">

                        <ul class="nav nav-pills nav-justified">
                            <li><a href="#ptab1" data-toggle="tab"><span>1:</span> 基本信息</a></li>
                            <li><a href="#ptab2" data-toggle="tab"><span>2:</span> 生产能力</a></li>
                            <li><a href="#ptab3" data-toggle="tab"><span>3:</span> 更多信息</a></li>
                        </ul>
                        <form class="form" id="firstForm" onsubmit="return false;">
                            @Html.AntiForgeryToken()
                            <div class="tab-content">

                                <div class="progress progress-striped active">
                                    <div class="progress-bar" role="progressbar" aria-valuenow="45" aria-valuemin="0" aria-valuemax="100"></div>
                                </div>

                                <div class="tab-pane" id="ptab1">
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label"><span class="asterisk">*</span> 公司名称</label>
                                        <div class="col-sm-6">
                                            @Html.TextBoxFor(m => m.CompanyName, new { @class = "form-control", @placeholder = "请用中文完整填写在工商局注册的公司全称" })
                                            @Html.ValidationMessageFor(m => m.CompanyName, null, new { @class="help-inline"})
                                            <span class="help-block">
                                                地区、字号、经营行业、公司体制，如：广州市格列服装有限公司；<br>
                                                个体经营者请按照“经营者姓名”+“个体经营”字样，如：“张三（个体经营）”<br>
                                            </span>
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label class="col-sm-3 control-label"><span class="asterisk">*</span> 工商注册号</label>
                                        <div class="col-sm-6">
                                            @Html.TextBoxFor(m => m.CompanyRegisteredNO, new { @class = "form-control", @placeholder = "请用工商局注册号" })
                                            @Html.ValidationMessageFor(m => m.CompanyRegisteredNO, null, new { @class="help-inline"})
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">企业类型</label>

                                        <div class="col-sm-5">
                                            <select id="CompanyTypeNO" class="form-control mb15">
                                                <option value="0"> --请选择-- </option>
                                            </select>

                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">企业人数</label>
                                        <div class="col-sm-5">
                                            <select id="CompanyMembers" class="form-control mb15">
                                                <option value="0"> -- 请选择 --</option>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">经营模式</label>
                                        <div class="col-sm-5" id="CompanyBusinessRadio">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">是否提供OEM、ODM</label>
                                        <div class="col-sm-5">

                                            <div class="rdio rdio-default">
                                                <input type="radio" name="radioOEM" id="radioDefault" value="0" @Html.IsChecked(Model.IsProvideOEM) />
                                                <label for="radioDefault">是</label>
                                            </div>

                                            <div class="rdio rdio-primary">
                                                <input type="radio" name="radioOEM" value="1" id="radioPrimary" @Html.IsChecked(!Model.IsProvideOEM) />
                                                <label for="radioPrimary">否</label>
                                            </div>

                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">主营行业</label>
                                        <div class="col-sm-6">
                                            <div class="col-sm-3">
                                                <select id="PrimaryBusinessCategory" class="form-control">
                                                    <option value="0"> -- 请选择 --</option>
                                                </select>
                                            </div>

                                            <div class="col-sm-5">
                                                <select id="PrimaryBusiness" class="form-control">
                                                    <option value="0"> -- 请选择 --</option>
                                                </select>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">主营产品</label>
                                        <div class="col-sm-1">
                                            <input type="text" id="PrimaryProduct1" value="@Model.PrimaryProduct" class="form-control">
                                        </div>
                                        <div class="col-sm-1">
                                            <input type="text" id="PrimaryProduct2" value="@Model.PrimaryProduct" class="form-control">
                                        </div>
                                        <div class="col-sm-1">
                                            <input type="text" id="PrimaryProduct3" value="@Model.PrimaryProduct" class="form-control">
                                        </div>
                                        <div class="col-sm-1">
                                            <input type="text" id="PrimaryProduct4" value="@Model.PrimaryProduct" class="form-control">
                                        </div>
                                        <div class="col-sm-1">
                                            <input type="text" id="PrimaryProduct5" value="@Model.PrimaryProduct" class="form-control">
                                        </div>

                                    </div>

                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">主要销售区域</label>
                                        <div class="col-sm-5">
                                            <select id="PrimarySalesArea" class="chosen-select" multiple data-placeholder="Choose an area...">
                                                <option value="0"> --请选择-- </option>
                                            </select>
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label class="col-sm-3 control-label"><span class="asterisk">*</span> 经营地址</label>
                                        <div class="col-sm-6">
                                            <div class="col-sm-3">
                                                <select id="BusinessProvince" class="form-control">
                                                    <option value="0"> --请选择-- </option>
                                                </select>
                                            </div>

                                            <div class="col-sm-3">
                                                <select id="BusinessCity" class="form-control">
                                                    <option value="0"> --请选择-- </option>
                                                </select>
                                            </div>
                                            @*<div class="col-sm-2">
                                                    <select id="BusinessArea" class="form-control">
                                                        <option value=""> --请选择-- </option>
                                                    </select>
                                                </div>*@

                                            <div class="col-sm-6">
                                                <input type="text" id="BusinessAddress" placeholder="" value="@ViewBag.BusinessAddress" class="form-control" />
                                                <span class="field-validation-valid help-inline" data-valmsg-replace="true" data-valmsg-for="BusinessAddress" />
                                                @*@Html.Editor("BusinessAddress")*@
                                                <span class="help-block">
                                                    你可以使用地图定位查看或修改位置。地图定位
                                                </span>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label class="col-sm-3 control-label"><span class="asterisk">*</span> 公司简介</label>
                                        <div class="col-sm-6">
                                            @Html.TextAreaFor(m => m.CompanyIntro, new { @class = "form-control" ,@rows="5"})
                                            @Html.ValidationMessageFor(m => m.CompanyIntro, null, new { @class="help-inline"})
                                            <span class="help-block">
                                                (限制500字以内)
                                            </span>
                                        </div>
                                    </div>
                                </div>
                                <div class="tab-pane" id="ptab2">
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">生产形式</label>
                                        <div class="col-sm-5">
                                            <select id="ProductionForm" class="form-control mb15">
                                                <option value="0"> -- 请如实填写您的生产形式，以便客户确认合作形式 --</option>
                                            </select>
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">服务领域</label>
                                        <div class="col-sm-5">
                                            <select id="ServicesDomain" class="chosen-select" multiple data-placeholder="Choose a service domain...">
                                                <option value="0"> --请选择-- </option>
                                            </select>
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">加工方式</label>
                                        <div class="col-sm-5">
                                            <select id="ProcessingMethod" class="chosen-select" multiple data-placeholder="Choose a processing method...">
                                                <option value="0"> --请选择-- </option>
                                            </select>
                                        </div>
                                    </div>


                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">加工工艺</label>
                                        <div class="col-sm-5">
                                            <select id="ProcessingCraft" class="chosen-select" multiple data-placeholder="Choose a processing craft...">
                                                <option value="0"> --请选择-- </option>
                                            </select>
                                        </div>
                                    </div>


                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">设备介绍</label>
                                        <div class="col-sm-5">
                                            <select id="EquipmentIntro" class="chosen-select" multiple data-placeholder="Choose a equipment intro...">
                                                <option value="0"> --请选择-- </option>
                                            </select>
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">研发部门人数</label>
                                        <div class="col-sm-5">
                                            <select id="ResearchDepartMembers" class="form-control mb15">
                                                <option value="0"> -- 请选择 --</option>
                                            </select>
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">产能介绍</label>
                                        <div class="col-sm-6">
                                            <div class="col-sm-2">
                                                <input type="text" id="CapacityIntro" placeholder="" value="@Model.CapacityIntro" class="form-control" />
                                            </div>
                                            <div class="col-sm-2">
                                                <select id="CapacityIntroUnit" class="form-control mb4">
                                                    <option value="0"> -- 请选择 --</option>
                                                </select>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">年营业额</label>
                                        <div class="col-sm-6">
                                            <select id="AnnualBusinessVolume" class="form-control mb4">
                                                <option value="0"> --请选择-- </option>
                                            </select>

                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">年出口额</label>
                                        <div class="col-sm-6">
                                            <select id="AnnualExportsVolume" class="form-control mb4">
                                                <option value="0">--请选择--</option>
                                            </select>

                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">管理体系认证</label>
                                        <div class="col-sm-5">
                                            <select id="ManagementSystemCertification" class="chosen-select" multiple data-placeholder="Choose a system certification...">
                                                <option value="0">--请选择--</option>
                                            </select>
                                        </div>
                                    </div>


                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">产品质量认证</label>
                                        <div class="col-sm-5">
                                            <select id="ProductQualityCertification" class="chosen-select" multiple data-placeholder="Choose a quality certification...">
                                                <option value="0">--请选择--</option>
                                            </select>
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">质量控制</label>
                                        <div class="col-sm-5" id="QualityAssurance">
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label class="col-sm-3 control-label"><span class="asterisk">*</span> 厂房面积</label>
                                        <div class="col-sm-6">
                                            <div class="col-sm-4">
                                                @Html.TextBoxFor(m => m.FactoryArea, new { @class = "form-control" })
                                                @Html.ValidationMessageFor(m => m.FactoryArea, null, new { @class="help-inline"})
                                            </div>
                                            <div class="col-sm-2">
                                                平方米
                                            </div>

                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">主要设备</label>
                                        <div class="col-sm-1">
                                            <input type="text" id="PrimaryEquipments1" value="@Model.PrimaryEquipments" class="form-control">
                                        </div>
                                        <div class="col-sm-1">
                                            <input type="text" id="PrimaryEquipments2" value="@Model.PrimaryEquipments" class="form-control">
                                        </div>
                                        <div class="col-sm-1">
                                            <input type="text" id="PrimaryEquipments3" value="@Model.PrimaryEquipments" class="form-control">
                                        </div>
                                        <div class="col-sm-1">
                                            <input type="text" id="PrimaryEquipments4" value="@Model.PrimaryEquipments" class="form-control">
                                        </div>
                                        <div class="col-sm-1">
                                            <input type="text" id="PrimaryEquipments5" value="@Model.PrimaryEquipments" class="form-control">
                                        </div>

                                    </div>
                                </div>
                                <div class="tab-pane" id="ptab3">
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">企业成立年份</label>
                                        <div class="col-sm-1">
                                            <select id="CompanyYearEstablished" class="form-control mb15">
                                                <option value="0"> --请选择-- </option>
                                            </select>
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label class="col-sm-3 control-label"> 企业网址</label>
                                        <div class="col-sm-6">
                                            @Html.TextBoxFor(m => m.CompanyWebsite, new { @class="form-control"})
                                            @Html.ValidationMessageFor(m => m.CompanyWebsite, null, new { @class="help-inline"})
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label"> 注册资本</label>
                                        <div class="col-sm-2">
                                            <input type="text" id="CompanyRegisteredAssets" placeholder="请根据营业执照如实填写，无需验资请填写" value="@Model.CompanyRegisteredAssets" class="form-control" />
                                        </div>
                                        <div class="col-sm-3">
                                            <select id="CompanyRegisteredAssetsUnit" class="form-control">
                                                <option value="0"> --请选择-- </option>
                                            </select>
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label class="col-sm-3 control-label"> 企业注册地</label>
                                        <div class="col-sm-6">
                                            <div class="col-sm-3">
                                                <select id="RegisteredProvince" class="form-control">
                                                    <option value="0"> --请选择-- </option>
                                                </select>
                                            </div>
                                            <div class="col-sm-4">
                                                <select id="RegisteredCity" class="form-control">
                                                    <option value="0"> --请选择-- </option>
                                                </select>
                                            </div>
                                            @*<div class="col-sm-2">
                                                    <select id="RegisteredArea" class="form-control">
                                                        <option value="">南山区</option>
                                                        <option value="">2013</option>
                                                        <option value="">2014</option>
                                                        <option value="">2015</option>
                                                        <option value="">...</option>
                                                    </select>
                                                </div>*@
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label class="col-sm-3 control-label"> 法人代表</label>
                                        <div class="col-sm-6">
                                            <input type="text" id="CompanyCorporateRepresentative" placeholder="" value="@Model.CompanyCorporateRepresentative" class="form-control" />
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label class="col-sm-3 control-label"> 开户行</label>
                                        <div class="col-sm-6">
                                            <input type="text" id="CompanyBankDeposit" placeholder="请选择开户行" value="@Model.CompanyBankDeposit" class="form-control" />
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label"> 账号</label>
                                        <div class="col-sm-6">
                                            @Html.TextBoxFor(m => m.CompanyBankAccount, new { @class="form-control"})
                                            @Html.ValidationMessageFor(m => m.CompanyBankAccount, null, new {@class="help-inline" })
                                        </div>
                                    </div>
                                </div>

                            </div><!-- tab-content -->
                            <ul class="pager wizard">
                                <li class="previous"><a href="javascript:void(0)">上一步</a></li>
                                <li class="next"><a href="javascript:void(0)">下一步</a></li>
                                <li><button id="BtnSave" class="btn btn-primary" style="display:block" onclick="javascript:Save()">保 存</button></li>
                            </ul>
                        </form>
                       
                    </div><!-- #basicWizard -->

                </div><!-- panel-body -->
            </div><!-- panel -->
        </div>

    </div>
</div>



<script>
    jQuery(document).ready(function () {
        //select option : CompanyTypeNO
        var CompanyTypejsons=@Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject((ObservableCollection<CompanyTypeMode>)ViewBag.CompanyTypeList))
        DropOption(CompanyTypejsons,$("#CompanyTypeNO"),@Model.CompanyTypeNO);

        //select option : CompanyMembers
        var CompanyMembersjsons=@Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject((ObservableCollection<CompanyMemberMode>)ViewBag.CompanyMemberList))
        DropOption(CompanyMembersjsons,$("#CompanyMembers"),@Model.CompanyMembers);

        //radio group : CompanyBusinessRadio
        var CompanyBusinessjsons=@Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject((ObservableCollection<CompanyBusinessMode>)ViewBag.CompanyBusinessList))
        RadioHtml(CompanyBusinessjsons, $("#CompanyBusinessRadio"), @Model.CompanyBusinessModel,"rdio rdio-primary","radioBusiness");

        //select option : ProductionForm
        var ProductionFormjsons=@Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject((ObservableCollection<ProductionFormMode>)ViewBag.ProductionFormList))
        DropOption(ProductionFormjsons,$("#ProductionForm"),@Model.ProductionForm);

        //select option : PrimarySalesArea , multiple
        var PrimarySalesAreajsons=@Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject((ObservableCollection<PrimarySalesAreaMode>)ViewBag.PrimarySalesAreaList))
        DropOption(PrimarySalesAreajsons,$("#PrimarySalesArea"),@Html.MutiDropDownSelectIsNull(Model.PrimarySalesArea));

        //select option : ServicesDomain , multiple
        var ServicesDomainjsons=@Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject((ObservableCollection<ServicesDomainMode>)ViewBag.ServicesDomainList))
        DropOption(ServicesDomainjsons,$("#ServicesDomain"),@Html.MutiDropDownSelectIsNull(Model.ServicesDomain));

        //select option : ProcessingMethod , multiple
        var ProcessingMethodjsons=@Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject((ObservableCollection<ProcessingMethodMode>)ViewBag.ProcessingMethodList))
        DropOption(ProcessingMethodjsons,$("#ProcessingMethod"),@Html.MutiDropDownSelectIsNull(Model.ProcessingMethod));

        //select option : ProcessingCraft , multiple
        var ProcessingCraftjsons=@Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject((ObservableCollection<ProcessingCraftMode>)ViewBag.ProcessingCraftList))
        DropOption(ProcessingCraftjsons,$("#ProcessingCraft"),@Html.MutiDropDownSelectIsNull(Model.ProcessingCraft));

        //select option : EquipmentIntro , multiple
        var EquipmentIntrojsons=@Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject((ObservableCollection<EquipmentIntroMode>)ViewBag.EquipmentIntroList))
        DropOption(EquipmentIntrojsons,$("#EquipmentIntro"),@Html.MutiDropDownSelectIsNull(Model.EquipmentIntro));

        //select option : ResearchDepartMembers
        var ResearchDepartMembersjsons=@Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject((ObservableCollection<CompanyMemberMode>)ViewBag.CompanyMemberList))
        DropOption(ResearchDepartMembersjsons,$("#ResearchDepartMembers"),@Model.ResearchDepartMembers);

        //select option : CapacityIntroUnit
        var CapacityIntroUnitjsons=@Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject((ObservableCollection<CapacityUnitMode>)ViewBag.CapacityUnitList))
        DropOption(CapacityIntroUnitjsons,$("#CapacityIntroUnit"),@Model.CapacityIntroUnit);

        //select option : AnnualBusinessVolume
        var AnnualBusinessVolumejsons=@Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject((ObservableCollection<AnnualBusinessVolumeMode>)ViewBag.AnnualBusinessVolumeList))
        DropOption(AnnualBusinessVolumejsons,$("#AnnualBusinessVolume"),@Model.AnnualBusinessVolume);

        //select option : AnnualExportsVolume
        var AnnualExportsVolumejsons=@Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject((ObservableCollection<AnnualExportsVolumeMode>)ViewBag.AnnualExportsVolumeList))
        DropOption(AnnualExportsVolumejsons,$("#AnnualExportsVolume"),@Model.AnnualExportsVolume);

        //select option : ManagementSystemCertification , multiple
        var ManagementSystemCertificationjsons=@Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject((ObservableCollection<ManagementSystemCertificationMode>)ViewBag.ManagementSystemCertificationList))
        DropOption(ManagementSystemCertificationjsons,$("#ManagementSystemCertification"),@Html.MutiDropDownSelectIsNull(Model.ManagementSystemCertification));

        //select option : ProductQualityCertification , multiple
        var ProductQualityCertificationjsons=@Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject((ObservableCollection<ProductQualityCertificationMode>)ViewBag.ProductQualityCertificationList))
        DropOption(ProductQualityCertificationjsons,$("#ProductQualityCertification"),@Html.MutiDropDownSelectIsNull(Model.ProductQualityCertification));

        //radio group : radioQualityAssurance
        var radioQualityAssurancejsons=@Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject((ObservableCollection<QualityAssuranceMode>)ViewBag.QualityAssuranceList))
        RadioHtml(radioQualityAssurancejsons, $("#QualityAssurance"), @Model.QualityAssurance,"rdio rdio-primary","radioQualityAssurance");

        //select option : CompanyYearEstablished
        var CompanyYearEstablishedjsons=@Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject((ObservableCollection<CompanyYearEstablishedMode>)ViewBag.CompanyYearEstablishedList))
        DropOption(CompanyYearEstablishedjsons,$("#CompanyYearEstablished"),@Model.CompanyYearEstablished);

        //select option : CompanyRegisteredAssetsUnit
        var CompanyRegisteredAssetsUnitjsons=@Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject((ObservableCollection<CompanyRegisteredAssetsUnitMode>)ViewBag.RegisteredAssetsUnitList))
        DropOption(CompanyRegisteredAssetsUnitjsons,$("#CompanyRegisteredAssetsUnit"),@Model.CompanyRegisteredAssetsUnit);

        //select default option
        // for drop down cascading [ PrimaryBusiness ]
        var IsBusinessCategory=DropOptionDefault(@Model.PrimaryBusinessCategory);
        var IsBusiness=DropOptionDefault(@Model.PrimaryBusiness);

        //for drop down cascading [ CompanyBusinessAddress ]
        var IsBusinessProvince=DropOptionDefault(@Model.CompanyBusinessProvince);
        var IsBusinessCity=DropOptionDefault(@Model.CompanyBusinessCity);

        //for drop down cascading [ CompanyRegisteredAddress ]
        var IsRegisteredProvince=DropOptionDefault(@Model.CompanyRegisteredProvince);
        var IsRegisteredCity=DropOptionDefault(@Model.CompanyRegisteredCity);

        //------------for drop down cascading [ PrimaryBusiness ]-------------
        ComAjaxGet("../xml/PrimaryBusiness.xml","PrimaryBusinessCategory","PrimaryBusiness","PrimaryBusinessCategory",IsBusinessCategory,"PrimaryBusiness",IsBusiness,0);
        jQuery("#PrimaryBusinessCategory").change(function(){
            var selectvalue = jQuery(this).val();
            ComAjaxGetForParent(selectvalue, "../xml/PrimaryBusiness.xml","PrimaryBusinessCategory","PrimaryBusiness","PrimaryBusiness", IsBusiness,0);
        });

        //--------------------------------------------------------------

        //------------for drop down cascading [ CompanyBusinessAddress ]------
        // <select> id : BusinessProvince , BusinessCity
        ComAjaxGet("../xml/City.xml","Province","City","BusinessProvince",IsBusinessProvince,"BusinessCity",IsBusinessCity,1);
        jQuery("#BusinessProvince").change(function(){
            var selectvalue = jQuery(this).val();
            ComAjaxGetForParent(selectvalue, "../xml/City.xml","Province","City","BusinessCity", IsBusinessCity,1);
        });

        ComAjaxGet("../xml/City.xml","Province","City","RegisteredProvince",IsRegisteredProvince,"RegisteredCity",IsRegisteredCity,1);
        jQuery("#RegisteredProvince").change(function(){
            var selectvalue = jQuery(this).val();
            ComAjaxGetForParent(selectvalue, "../xml/City.xml","Province","City","RegisteredCity", IsRegisteredCity,1);
        });

        //--------------------------------------------------------------------

        // Progress Wizard
        $('#progressWizard').bootstrapWizard({
            'nextSelector': '.next',
            'previousSelector': '.previous',
            onNext: function (tab, navigation, index) {
                var $total = navigation.find('li').length;
                var $current = index + 1;
                var $percent = ($current / $total) * 100;
                jQuery('#progressWizard').find('.progress-bar').css('width', $percent + '%');

            },
            onPrevious: function (tab, navigation, index) {
                var $total = navigation.find('li').length;
                var $current = index + 1;
                var $percent = ($current / $total) * 100;
                jQuery('#progressWizard').find('.progress-bar').css('width', $percent + '%');
            },
            onTabShow: function (tab, navigation, index) {
                var $total = navigation.find('li').length;
                var $current = index + 1;
                var $percent = ($current / $total) * 100;
                jQuery('#progressWizard').find('.progress-bar').css('width', $percent + '%');
                jQuery('#progressWizard').find('.next').attr('style','display:none');
                jQuery('#progressWizard').find('.previous').attr('style','display:none');
                $("#BtnSave").attr('style','display:block');

            }
        });

        // With Form Validation Wizard
        var $validator = jQuery("#firstForm").validate({
            rules:{
                CompanyName:{
                    required:true,
                    stringCNCheck:true
                },
                CompanyRegisteredNO:{
                    required:true,
                    stringNUCheck:true
                },
                BusinessAddress:{
                    required:true,
                    stringCNNCheck:true
                },
                CompanyIntro:{
                    required:true,
                    stringContentCheck:[1,1000]
                },
                FactoryArea:{
                    required:true,
                    floatCheck:true
                },
                CompanyWebsite:{
                    siteCheck:true
                },
                CompanyBankAccount:{
                    bankCheck:true
                }
            },
            messages:{
                CompanyName:{
                    required:"请输入工商局注册的公司完整名称",
                    stringCNCheck:"只能包括中文字、( 和 )"
                },
                CompanyRegisteredNO:{
                    required:"请输入工商局注册号",
                    stringNUCheck:"只能包括英文字母和数字"
                },
                BusinessAddress:{
                    required:"请确保企业经营地址不为空",
                    stringCNNCheck:"只能包括中文字"
                },
                CompanyIntro:{
                    required:"请输入公司简介",
                    stringContentCheck:$.validator.format("请确保内容输入{0}-{1}字节以内")
                },
                FactoryArea:{
                    required:"请输入厂房面积",
                    floatCheck:"只能包括数字或者小数位数字"
                },
                CompanyWebsite:{
                    siteCheck:"只能是一个合法有效的网址"
                },
                CompanyBankAccount:{
                    bankCheck:"只能包括19位数字"
                }
            },
            highlight: function (element) {
                jQuery(element).closest('.form-group').removeClass('has-success').addClass('has-error');
            },
            success: function (element) {
                jQuery(element).closest('.form-group').removeClass('has-error');
            },
            focusInvalid: false,
            onkeyup: false,
            errorPlacement: function (error, element) {
                //error.appendTo(element.next("span"));
                error.insertAfter($(element).parent().children().last());
            }
        });


        jQuery('#progressWizard').bootstrapWizard({
            tabClass: 'nav nav-pills nav-justified nav-disabled-click',
            onTabClick: function (tab, navigation, index) {
                return false;
            },
            onNext: function (tab, navigation, index) {
                var $valid = jQuery('#firstForm').valid();
                if (!$valid) {
                    $validator.focusInvalid();
                    return false;
                }
            }
        });

        // Chosen Select
        jQuery(".chosen-select").chosen({ 'width': '100%', 'white-space': 'nowrap' });

        // Textarea Autogrow
        jQuery('#CompanyIntro').autogrow();

    });

    function callBack() {
        window.location ="/Users/Login";
    }

    function Save()
    {
        //var $valid = jQuery('#firstForm').valid();
        //if (!$valid) {
        //    $validator.focusInvalid();
        //    return false;
        //}
        //else{

        @{
                var IsInsert = 1; // default option : insert new company model
                var CompanyID = 0;
                var UserModel = OperatorFactory.GetUser(User.Identity.GetUserId());
                if (UserModel != null && UserModel.CompanyID !=null&& UserModel.CompanyID.Value > 0) // UserModel.CompanyID.Value : update existing company model
                {
                    IsInsert = 0;
                    CompanyID = UserModel.CompanyID.Value;
                }
            }

        var TabIndex=  $('#progressWizard').bootstrapWizard('currentIndex');
        //------------------TAB 01 : 基本信息
        var valCompanyName=$.jsparams.input("CompanyName");
        var valCompanyRegisteredNO=$.jsparams.input("CompanyRegisteredNO");
        var valCompanyTypeNO=$.jsparams.select("CompanyTypeNO");
        var valCompanyMembers=$.jsparams.select("CompanyMembers");
        var valCompanyBusinessModel=$.jsparams.radio("radioBusiness");
        var valIsProvideOEM=$.jsparams.radio("radioOEM");
        var valPrimaryBusinessCategory=$.jsparams.select("PrimaryBusinessCategory");
        var valPrimaryBusiness=$.jsparams.select("PrimaryBusiness");
        //---------------PrimaryProduct 1,,,,5
        var valPrimaryProduct=$.jsparams.input_multiple("PrimaryProduct");
        //---------------PrimarySalesArea
        var valPrimarySalesArea=$.jsparams.select_multiple("PrimarySalesArea");
        //---------------
        var valBusinessProvince=$.jsparams.select("BusinessProvince");
        var valBusinessCity=$.jsparams.select("BusinessCity");
        var valCompanyIntro=$.jsparams.input("CompanyIntro");

        //-----------------TAB 02 : 生产能力
        var valProductionForm=$.jsparams.select("ProductionForm");
        //---------------ServicesDomain
        var valServicesDomain=$.jsparams.select_multiple("ServicesDomain");
        //--------------ProcessingMethod
        var valProcessingMethod=$.jsparams.select_multiple("ProcessingMethod");
        //-------------ProcessingCraft
        var valProcessingCraft=$.jsparams.select_multiple("ProcessingCraft");
        //-------------EquipmentIntro
        var valEquipmentIntro=$.jsparams.select_multiple("EquipmentIntro");

        var valResearchDepartMembers=$.jsparams.select("ResearchDepartMembers");
        var valCapacityIntro=$.jsparams.input("CapacityIntro");
        var valCapacityIntroUnit=$.jsparams.select("CapacityIntroUnit");
        var valAnnualBusinessVolume=$.jsparams.select("AnnualBusinessVolume");
        var valAnnualExportsVolume=$.jsparams.select("AnnualExportsVolume");
        //-------------ManagementSystemCertification
        var valManagementSystemCertification=$.jsparams.select_multiple("ManagementSystemCertification");
        //-------------ProductQualityCertification
        var valProductQualityCertification=$.jsparams.select_multiple("ProductQualityCertification");

        var valQualityAssurance=$.jsparams.radio("radioQualityAssurance");
        var valFactoryArea=$.jsparams.input("FactoryArea");

        //-------------PrimaryEquipments 1,,,,5
        var valPrimaryEquipments=$.jsparams.input_multiple("PrimaryEquipments");

        //-----------------TAB 03 : 更多信息
        var valCompanyYearEstablished=$.jsparams.select("CompanyYearEstablished");
        var valCompanyWebsite=$.jsparams.input("CompanyWebsite");
        var valCompanyRegisteredAssets=$.jsparams.input("CompanyRegisteredAssets");
        var valCompanyRegisteredAssetsUnit=$.jsparams.select("CompanyRegisteredAssetsUnit");
        var valCompanyRegisteredProvince=$.jsparams.select("RegisteredProvince");
        var valCompanyRegisteredCity=$.jsparams.select("RegisteredCity");
        var valCompanyCorporateRepresentative=$.jsparams.input("CompanyCorporateRepresentative");
        var valCompanyBankDeposit=$.jsparams.input("CompanyBankDeposit");
        var valCompanyBankAccount=$.jsparams.input("CompanyBankAccount");

        //......
        if(TabIndex==0){
            
            jQuery("#firstForm").validate({
                ignore:"#FactoryArea,#CompanyWebsite,#CompanyBankAccount"
            });
            var $valid = jQuery('#firstForm').valid(); 
            if (!$valid)
            {
                return false;
            }
            else
            {
                var datas={ CompanyID:@CompanyID,IsInsert:@IsInsert,CompanyName:valCompanyName,CompanyRegisteredNO:valCompanyRegisteredNO,
                    CompanyTypeNO:valCompanyTypeNO,CompanyMembers:valCompanyMembers,CompanyBusinessModel:valCompanyBusinessModel,IsProvideOEM:valIsProvideOEM,
                    PrimaryBusinessCategory:valPrimaryBusinessCategory,PrimaryBusiness:valPrimaryBusiness,PrimaryProduct:valPrimaryProduct,PrimarySalesArea:valPrimarySalesArea,
                    CompanyBusinessProvince:valBusinessProvince,CompanyBusinessCity:valBusinessCity,CompanyIntro:valCompanyIntro};
                ComAjax("/Company/CompanyBaseInfo",datas,"基本信息","callBack");
            }
        }
        else if(TabIndex==1){
            
            jQuery("#firstForm").validate({
                ignore:"#CompanyName,#CompanyRegisteredNO,#BusinessAddress,#CompanyIntro,#CompanyWebsite,#CompanyBankAccount"
            });
            var $valid = jQuery('#firstForm').valid();
            if (!$valid)
            {
                return false;
            }
            else
            {
                var datas={ CompanyID:@CompanyID,IsInsert:@IsInsert,ProductionForm:valProductionForm,ServicesDomain:valServicesDomain,ProcessingMethod:valProcessingMethod,
                    ProcessingCraft:valProcessingCraft,EquipmentIntro:valEquipmentIntro,ResearchDepartMembers:valResearchDepartMembers,CapacityIntro:valCapacityIntro,CapacityIntroUnit:valCapacityIntroUnit,
                    AnnualBusinessVolume:valAnnualBusinessVolume,AnnualExportsVolume:valAnnualExportsVolume,ManagementSystemCertification:valManagementSystemCertification,
                    ProductQualityCertification:valProductQualityCertification,QualityAssurance:valQualityAssurance,FactoryArea:valFactoryArea,PrimaryEquipments:valPrimaryEquipments};
                ComAjax("/Company/CompanyBaseInfoCapacity",datas,"生产能力");
            }

        }
        else if(TabIndex==2){
            
            jQuery("#firstForm").validate({
                ignore:"#CompanyName,#CompanyRegisteredNO,#BusinessAddress,#CompanyIntro,#FactoryArea"
            });
            var $valid = jQuery('#firstForm').valid();
            if (!$valid)
            {
                return false;
            }
            else
            {
                var datas={ CompanyID:@CompanyID,IsInsert:@IsInsert,CompanyYearEstablished:valCompanyYearEstablished,CompanyWebsite:valCompanyWebsite,CompanyRegisteredAssets:valCompanyRegisteredAssets,
                    CompanyRegisteredAssetsUnit:valCompanyRegisteredAssetsUnit,CompanyRegisteredProvince:valCompanyRegisteredProvince,CompanyRegisteredCity:valCompanyRegisteredCity,
                    CompanyCorporateRepresentative:valCompanyCorporateRepresentative,CompanyBankDeposit:valCompanyBankDeposit,CompanyBankAccount:valCompanyBankAccount};
                ComAjax("/Company/CompanyBaseInfoMore",datas,"更多信息");
            }
        }
    }
    //}

</script>
